<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  <meta name="renderer" content="webkit" />
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
  <title>千峰教育大前端Vue教学</title>
  <!-- 引入vue -->
  <script src="https://cdn.staticfile.org/vue/3.0.5/vue.global.js"></script>
  <script src="https://unpkg.com/mitt/dist/mitt.umd.js"></script>
  <script src="child.js"></script>
  <script src="parent.js"></script>
</head>

<body style="margin:100px;font-size:22px;">
  <!-- 定义一个容器 -->
	<div id="app">
		<!-- 入口只加载Parent -->
		<Parent></Parent>
	</div>
  <script>
    // 创建应用
    const app = Vue.createApp({
      // 初始化数据函数
      components: {
        Parent, // 声明组件
      },
      provide: { // 注入一个全局的$bus
        $bus: mitt(),
      },
    });
    // 挂载应用
    app.mount('#app');
  </script>
</body>

</html>